#include "game.h"
bool eqn(int n, int x, int y) {
    std::vector<int> v(n);
    v[x - 1] = y;
    int sum = 0;
    for (int i = 1; i <= n - 1; i++) {
        int val = i;
        for (int j = 1; j <= n; j++) {
            if (j != x) {
                val++;
                if (val == n) val = 1;
                if (val >= y) {
                    v[j - 1] = val + 1;
                } else {
                    v[j - 1] = val;
                }
            }
        }
        sum += count(v);
    }
    return (sum == ((n - 1) << 1));
}
std::vector<int> guess(int n, int limit) {
    std::vector<int> v(n);
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
            if (eqn(n, i, j)) {
                v[i - 1] = j;
            }
        }
    }
    return v;
}